package com.sojson.project.monitor.job.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sojson.project.monitor.job.dao.JobLogDao;
import com.sojson.project.monitor.job.entity.dto.JobLogDto;
import com.sojson.project.monitor.job.entity.dto.JobLogPageDto;
import com.sojson.project.monitor.job.entity.po.JobLog;
import com.sojson.project.monitor.job.entity.vo.JobLogVo;
import com.sojson.project.monitor.job.service.JobLogService;

/**
 * 定时任务调度日志Service实现类
 * 
 * @author liu
 * @date 2022-10-24
 */
@Service
public class JobLogServiceImpl extends ServiceImpl<JobLogDao, JobLog> implements JobLogService {

    @Resource
    private JobLogDao jobLogDao;

    /**
     * 通过对象查找
     * 
     * @param dto
     * @return
     */
    @Override
    public List<JobLogVo> list(JobLogDto dto) {
        List<JobLogVo> list = jobLogDao.list(dto);
        return list;
    }

    /**
     * 通过对象分页查找
     * 
     * @param dto
     * @return
     */
    @Override
    public List<JobLogVo> page(JobLogPageDto dto) {
        List<JobLogVo> page = jobLogDao.page(dto);
        return page;
    }

    /**
     * 通过对象删除
     * 
     * @param dto
     * @return
     */
    @Override
    public boolean removeByDto(JobLogDto dto) {
        jobLogDao.removeByDto(dto);
        return true;
    }

    /**
     * 清空数据
     * 
     * @return
     */
    @Override
    public boolean clear() {
        jobLogDao.clear();
        return true;
    }

    /**
     * 通过id查找
     * 
     * @param id
     * @return
     */
    @Override
    public JobLogVo findById(String id) {
        JobLogVo findById = jobLogDao.findById(id);
        return findById;
    }

}